import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect:'/index',
    children:[
      {path: '/index', component: () => import('../views/Index/UserIndex.vue')},
      {path: '/practiceSearch', name:'practiceSearch',component: () => import('../views/search/PracticeSearch.vue')},
      {path: '/bindCompany', component: () => import('../views/HR/bindCompany.vue')},
      {path: '/userCenter', component: () => import('../views/User/userCenter.vue')},
      {path: '/Ssearch', name:'Ssearch', component: () => import('../views/search/SchoolSearch.vue')},
      {path: '/Csearch', component: () => import('../views/search/CompanySearch.vue')},
      {path: '/Resume',name: '/Resume', component: () => import('@/views/resume/CreateResume.vue')},
      {path: '/LResume', component: () => import('../views/resume/LookResume.vue')},
      {path: '/JobDetail', name: '/JobDetail',component: () => import('@/views/detail/JobDetails.vue')},
      {path: '/CompanyDetail', name: '/CompanyDetail',component: () => import('@/views/detail/CompanyDetails.vue')},
        {path: '/chat', name: '/chat',component: () => import('@/views/chat/chat2.vue')},
      {
        path: '/forum',
        name: 'home3',
        component: () => import('../views/forum/ForumView.vue'),
        redirect:'/forum',
        children:[
          {path: '/check', component: () => import('../views/forum/CheckView.vue')},
          {path: '/hand', component: () => import('../views/forum/HandPickView.vue')},
          {path: '/feed', component: () => import('../views/forum/FeedbackView.vue')},
          {path: '/question', component: () => import('../views/forum/QuestionView.vue')},
        ]
      },

    ]
  },
  {
    path: '/jobPosting',
    name: 'home2',
    component: () => import('../views/HrView.vue'),
    redirect:'/jobPosting',
    children:[
      {path: '/jobPosting', component: () => import('../views/HR/jobPosting.vue')},
      {path: '/HrCenter', component: () => import('../views/HR/HrCenter.vue')},
    ]
  },
  {path: '/login', component: () => import('../views/login/login.vue')},
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})


export default router
